package c.h.a.w.m;

import android.annotation.SuppressLint;
import android.os.Handler;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import b.b.c.f;
import c.h.a.m0.j;
import c.h.a.w.e;
import com.liuzh.deviceinfo.DeviceInfoApp;
import com.liuzh.deviceinfo.analyzer.view.LargeFileFloatingView;
import java.io.File;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;

/* compiled from: LargeFileFloatingView */
public class b implements Runnable {
    public final /* synthetic */ Handler a;
    public final /* synthetic */ TextView b;
    public final /* synthetic */ ProgressBar c;
    public final /* synthetic */ f d;
    public final /* synthetic */ LargeFileFloatingView e;

    /* compiled from: LargeFileFloatingView */
    public class a {
        public int a = 0;

        /* compiled from: LargeFileFloatingView */
        public class a implements Runnable {
            public final /* synthetic */ List a;
            public final /* synthetic */ List b;

            public a(List list, List list2) {
                this.a = list;
                this.b = list2;
            }

            public void run() {
                f fVar = b.this.d;
                if (fVar != null && fVar.isShowing()) {
                    b.this.d.dismiss();
                }
                DeviceInfoApp deviceInfoApp = DeviceInfoApp.c;
                Toast.makeText(deviceInfoApp, deviceInfoApp.getString(2131689789, new Object[]{Integer.valueOf(this.a.size()), Integer.valueOf(this.b.size())}), 1).show();
                if (!(b.this.e.getLargeFile() == null || b.this.e.getLargeFile().b == null)) {
                    for (File absolutePath : this.a) {
                        int indexOf = b.this.e.getLargeFile().b.indexOf(absolutePath.getAbsolutePath());
                        b.this.e.getLargeFile().b.remove(indexOf);
                        ((e) b.this.e.getLargeFile().a.remove(indexOf)).a(0, true);
                    }
                    if (b.this.e.getLargeFile().a.isEmpty()) {
                        b.this.e.findViewById(2131296535).setVisibility(0);
                        b.this.e.findViewById(2131296830).setVisibility(8);
                    }
                }
                b.this.e.e.clear();
                b.this.e.f.a.b();
                b.this.e.c();
            }
        }

        public void a(List<File> list, List<File> list2) {
            b.this.a.post(new a(list, list2));
        }

        @SuppressLint({"SetTextI18n"})
        public void b(Object obj) {
            File file = (File) obj;
            b.this.a.post(new a(this));
        }
    }

    public b(LargeFileFloatingView largeFileFloatingView, Handler handler, TextView textView, ProgressBar progressBar, f fVar) {
        this.e = largeFileFloatingView;
        this.a = handler;
        this.b = textView;
        this.c = progressBar;
        this.d = fVar;
    }

    public void run() {
        ArrayList arrayList = new ArrayList(this.e.e.size());
        for (String file : this.e.e) {
            arrayList.add(new File(file));
        }
        a aVar = new a();
        String[] strArr = j.a;
        LinkedList linkedList = new LinkedList();
        LinkedList linkedList2 = new LinkedList();
        Iterator it = arrayList.iterator();
        while (it.hasNext()) {
            File file2 = (File) it.next();
            aVar.b(file2);
            if (j.a(file2)) {
                linkedList2.add(file2);
            } else {
                linkedList.add(file2);
            }
        }
        aVar.a(linkedList2, linkedList);
    }
}
